package com.top10.service.impl;

import com.top10.entity.Goods;
import com.top10.entity.vo.GoodsWithIntCategoryVo;
import com.top10.mapper.GoodsMapper;
import com.top10.mapper.IntCategoryMapper;
import com.top10.service.IGoodsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author su
 * @since 2018-09-29
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {



    @Autowired
    private GoodsMapper goodsMapper;


    public List<GoodsWithIntCategoryVo> selectglobalgoods(){
        return goodsMapper.selectglobalgoods();
    }

    @Override
    public List<Map<String, Object>> selectgoodsbycategory(String categoryuuid) {
        return goodsMapper.selectgoodsbycategory(categoryuuid);
    }
    @Override
    public List<String> selectgoodsbycategorytwo(String categoryuuid) {
        return goodsMapper.selectgoodsbycategorytwo(categoryuuid);
    }

    @Override
    public List<Map<String, Object>> selectgoodsbycategoryasc(String categoryuuid) {
        return goodsMapper.selectgoodsbycategoryasc(categoryuuid);
    }

    @Override
    public List<Map<String, Object>> selectgoodsbyprice(String categoryuuid) {
        return goodsMapper.selectgoodsbyprice(categoryuuid);
    }

    @Override
    public List<Map<String, Object>> selectgoodsbypriceasc(String categoryuuid) {
        return goodsMapper.selectgoodsbycategoryasc(categoryuuid);
    }

    @Override
    public List<Map<String, Object>> selectgoodsbyexpress(String categoryuuid) {
        return goodsMapper.selectgoodsbyexpress(categoryuuid);
    }

    @Override
    public List<Map<String, Object>> selectglobalgoodsbysort() {
        return goodsMapper.selectglobalgoodsbysort();
    }

    @Override
    public List<Map<String, Object>> selectglobalgoodsbysortasc() {
        return goodsMapper.selectglobalgoodsbysortasc();
    }

    @Override
    public List<Map<String, Object>> selectglobalgoodsbyprice() {
        return goodsMapper.selectglobalgoodsbyprice();
    }

    @Override
    public List<Map<String, Object>> selectglobalgoodsbypriceasc() {
        return goodsMapper.selectglobalgoodsbypriceasc();
    }

    @Override
    public List<Map<String, Object>> selectglobalgoodsbyexpress() {
        return goodsMapper.selectglobalgoodsbyexpress();
    }

    @Override
    public List<Map<String, Object>> selecttoday() {
        return goodsMapper.selecttoday();
    }

    @Override
    public List<Map<String, Object>> selecthot() {
        return goodsMapper.selecthot();
    }

    @Override
    public List<Map<String, Object>> selectnew() {
        return goodsMapper.selectnew();
    }

    @Override
    public List<Map<String, Object>> selectsold() {
        return goodsMapper.selectsold();
    }

    @Override
    public List<Map<String, Object>> selectGetRecommendGoods(String shopuuid) {
        return goodsMapper.selectGetRecommendGoods(shopuuid);
    }


    /**
     * 获取商品封面
     * @param uuid
     * @return
     * @throws Exception
     */
    @Override
    public String getShow(String uuid)throws Exception{
        return goodsMapper.getShow(uuid);
    }
    /**
     * 搜索商品的接口
     */
    @Override
    public List<Map<String,Object>>selectAllGood(String keyword){
        return goodsMapper.selectAllGood(keyword);
    }
    @Override
    public List<Map<String,Object>>selectallGoodByPriceOne(String keyword){
        return goodsMapper.selectAllGoodByPrice(keyword);
    }
    @Override
    public List<Map<String,Object>>selectallGoodByPricessOne(String keyword){
        return goodsMapper.selectAllGoodByPricess(keyword);
    }
    @Override
    public List<Map<String,Object>>selectallGoodBySalesOne(String keyword){
        return goodsMapper.selectallGoodBySalesOne(keyword);
    }
    @Override
    public List<Map<String,Object>>selectallGoodBySalessOne(String keyword){
        return goodsMapper.selectallGoodBySalessOne(keyword);
    }
}
